
/**
 *
 * @author group_0217
 */
import java.util.HashMap;

public abstract class Data {
    // Super class of Directory and File.

    // The name of the Data.
    private String Name;
    // The parent Direcory of the Data.
    protected Directory parent;

    /**
     * Sets the name of the Data object.
     * @param name the name of the Data.
     */
    public Data(String name) {
        // Create a new Data object whose Name is name.
        this.Name = name;
    }

    /**
     * 
     * @return the name of the Data Object.
     */
    public String returnName() {
        // Return the Name.
        return Name;
    }

    /**
     * 
     * @return a Directory object which is the parent of this Data object.
     */
    public Directory getParent() {
        return parent;
    }

    /**
     * Sets the parent of this Data object.
     * @param parent the parent Directory.
     */
    public void setParent(Directory parent) {
        this.parent = parent;
    }

    public abstract Data copy();

    public abstract void list();

    public abstract String grep(String regex);

    public void helpCopy(Data data) {
    }

    public void setParent(HashMap<String, Data> dir) {
    }
}
